# demo01_oop.py   oop: 面向对象编程
class BearToy:  # self: 当前对象
    def __init__(self, s, c):
        # 初始化方法: 创建对象后自动调用
        self.size = s
        self.color = c
    def say(self):
        # b1.say()
        # self---->b1  b1.size    b1.color
        print(f"我是{self.size} {self.color}泰迪熊")
# 1.通过类名(属性值),属性值给init方法传递实际参数
# 2.实际参数从而给对象属性赋值
b1 = BearToy("big", "yellow")  # 创建对象
b1.say()  # 调用方法: 对象.方法名()




b2 = BearToy("little", "blue")
b2.say()



# b1 = BearToy()  # 创建对象: 类名()
# b1.size = "little"  # 对象.属性=属性值
# b1.color = "black"
# b1.say()  # 对象.方法名()
# b2 = BearToy()
# b2.size = "big"
# b2.color = "yellow"
# b2.say()